﻿/*
 *  Source code courtesy of the desktopWeb.CodePlex.com community project. See MS-PL license on Codeplex.com. 
 *  This is beta code not intended for a production application.
 */

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MyData.SharePoint
{
  public partial class PermissionsForm : Form
  {
    public PermissionsForm()
    {
      InitializeComponent();
    }

    private void closeButton_Click(object sender, EventArgs e)
    {
      this.Close();
    }

    private void PermissionsForm_Load(object sender, EventArgs e)
    {
      Permissions p = new Permissions();

      nameTextBox.Text = p.CurrentUser.Name;

      manageWebCheckBox.Checked = p.CurrentUser.CanManage;

      try{
        Cursor.Current = Cursors.WaitCursor;
        allUsersDataGridView.DataSource = p.PersonUserInfoList;
      }
      catch(Exception ex)
      {
        //Next: Add - Logging.Log(System.Diagnostics.TraceEventType.Error,"PersonUserInfoList", ex.Message);
      }
      finally
      {
        Cursor.Current = Cursors.Default;
      }

    }

  }
}
